package soundwave.com.demo.list;

import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.widget.GridView;
import android.widget.TextView;

import java.util.ArrayList;

import soundwave.com.demo.R;
import soundwave.com.demo.adpater.TakeoutfoodGrid_adapert;
import soundwave.com.demo.test.TakeoutfoodGrid_test;

/**
 * Created by xu on 2017/3/30.
 */

public class TakeoutfoodGrid_item extends Activity {
    private GridView takeoutfood_content;
    private TextView back;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.takeoufood_content);
        initView();
        onclik();

        takeoutfood_content = (GridView) findViewById(R.id.takeoutfood_gridview);
        ArrayList<TakeoutfoodGrid_test> content = new ArrayList<>();
        TakeoutfoodGrid_test takeoutfoodcontent_test = new TakeoutfoodGrid_test();
        takeoutfoodcontent_test.getTakeoutfood_img();
        takeoutfoodcontent_test.getTakeoutfood_name();
        takeoutfoodcontent_test.getTakeoutfood_money();

        TakeoutfoodGrid_adapert takeoutfoodGrid_adapert = new TakeoutfoodGrid_adapert(this, R.layout.takeoutfood_gridview, content);
        takeoutfood_content.setAdapter(takeoutfoodGrid_adapert);
        takeoutfoodGrid_adapert.notifyDataSetChanged();

    }

    private void initView() {
        back = (TextView) findViewById(R.id.back);
    }
    private void onclik(){
        back.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                finish();
            }
        });
    }
}
